#ifndef STREAMRECORDERMANAGER_H
#define STREAMRECORDERMANAGER_H

#include "streamrecorderconfig.h"

class StreamRecorderController;

class StreamRecorderManager : public QObject
{
    Q_OBJECT
public:
    explicit StreamRecorderManager(QObject* parent = nullptr);
    ~StreamRecorderManager();

    bool isRunning(int id) const;
    int start(const StreamRecorderConfig& config);
    void stop(int id);
    void stopAll();
    void terminate(int id);
    void terminateAll();

Q_SIGNALS:
    void positionChanged(int id, qint64 pos);
    void qosMetrics(int id, double fps, double bitrate);
    void finished(int id, const QString& filename, qint64 duration);
    void errorOccurred(int id, const QString& error);

private:
    QList<StreamRecorderController*> controllers_;
};

#endif // STREAMRECORDERMANAGER_H
